#!/usr/bin/node
const log = console.log;

let timer1,count = 1;

timer1 = setInterval(()=>{
  log('timer1 starts!');
},500);

setTimeout(()=>{
  clearInterval(timer1);
  
  const timer2 = setInterval(()=>{
    log('timer2 starts!');
    if(count++ >= 5){
      count = 0;
      clearInterval(timer2);
    } 
  },500);
},5000);



